
public class Mathey 
{
	public static void ulamsHypthesis(int cnt)
	{
		int num = 0;
        for (int i = 1;i <= cnt; i++)
        {
            num = i;
            System.out.print(i + ": ");
            do
            {
                if (num % 2 == 0)
                    num /= 2;
                else
                    num = (num * 3) + 1;
                System.out.print(num + " ");
            }
            while (num != 1);
            
            
            System.out.println("");
        }
	}
}
